var myChart = echarts.init(document.getElementById('main'));
$.ajaxSetup({
    async: false
});
$.post("tushu/tongji",function (data) {
    var name=[];
    var count =[]
    $.each(data.tushus,function (index,dom) {
        name.push(dom.tu_name)
        count.push(dom.cishu)
    })
;    option = {
        xAxis: {
            type: 'category',
            data:name

        },
        yAxis: {
            type: 'value'
        },
        series: [{
            data: count,
            type: 'bar'
        }]
    };
},'json');
myChart.setOption(option);